# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=ghostwriter
pkgver=23.08.4
pkgrel=0
pkgdesc="Distraction-free markdown editor"
url="https://invent.kde.org/office/ghostwriter/"
arch="aarch64 x86_64"
license="GPL-3.0-or-later"
depends="qt5-qtsvg"
makedepends="
	extra-cmake-modules
	hunspell-dev
	sonnet5-dev
	kcoreaddons5-dev
	kdoctools5-dev
	kxmlgui5-dev
	kconfigwidgets5-dev
	qt5-qtsvg-dev
	qt5-qttools-dev
	qt5-qtbase-dev
	qt5-qtwebchannel-dev
	qt5-qtwebengine-dev
	samurai
	"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/office/ghostwriter.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/ghostwriter-$pkgver.tar.xz"
options="!check" # no tests

build() {
	CXXFLAGS="$CXXFLAGS -flto=auto" \
	cmake -B build -G Ninja -Wno-dev \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
217d512d338a4beb8c56c6c7c6e7d48fe1d06da8d6845700e92373c37450082ffe310281aeaeff78050e2cc89a59d46cf439e1e54e83a82c0b510f9e2c8533e8  ghostwriter-23.08.4.tar.xz
"
